#include <Windows.h>
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 600
class CScreen
{
public:
	int m_nLimLeft, m_nLimRight, m_nLimBottom;
	RECT m_RCamera;
	CScreen( int _leftCamera, int _limLeft, int _limRight, int _limBottom)
	{

		m_nLimLeft = _limLeft;
		m_nLimRight = _limRight;
		m_nLimBottom = _limBottom;

		m_RCamera.left = _leftCamera;
		m_RCamera.top = 0;
		m_RCamera.right = m_RCamera.left + WINDOW_WIDTH;
		m_RCamera.bottom = m_RCamera.top + WINDOW_HEIGHT;
	}

	void ResetCamera()
	{
		m_RCamera.left = 0;
		m_RCamera.top = 0;
		m_RCamera.bottom = m_RCamera.top + WINDOW_HEIGHT;
		m_RCamera.right = m_RCamera.left + WINDOW_WIDTH;
	}

	void MoveCamera(int DeltaX)
	{
		if (m_RCamera.left < 0)
		{
			m_RCamera.left = 0;
			m_RCamera.right = WINDOW_WIDTH;
			return;
		}
		else if (m_RCamera.right > m_nLimRight)
		{
			m_RCamera.right = m_nLimRight;
			m_RCamera.left = m_nLimRight - WINDOW_WIDTH;
			return;
		}
		//move camera
		m_RCamera.left += DeltaX;
		m_RCamera.right += DeltaX;
	}
};